package com.snsoft.service.environment;

import java.sql.SQLException;

import com.snsoft.bean.GreenHouse;
import com.snsoft.dao.EnvironmentDao;
import com.snsoft.exception.GreenHouseNotFound;

/**
 * 
 * @copyright ：神农大学生软件创新中心 版权所有 © 2017
 * 
 * @author 16计算机弓耀
 * 
 * @version 1.0
 * 
 * @date 2017年11月8日下午7:01:22
 * 
 * @Description TODO
 *	获取温室信息接口
 */
public class GetGreenHouseInfoService {
	public GreenHouse getGreenHouseInfo(int greenHouseID) throws SQLException, GreenHouseNotFound{
		EnvironmentDao ed = new EnvironmentDao();
		GreenHouse green = ed.getGreenHouseInfo(greenHouseID);
		if(green == null) {
			throw new GreenHouseNotFound("温室不存在");
		}
		return green;
	}
}
